<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE PolyKinds #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      :  Data.Proxy</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the LICENSE file in the distribution)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Definition of a Proxy type (poly-kinded in GHC)</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- @since 4.7.0.0</span><span>
</span><span id="line-17"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Proxy</span><span>
</span><span id="line-20"></span><span>  </span><span class="hs-special">(</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier">Proxy</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Proxy.html#asProxyTypeOf"><span class="hs-identifier">asProxyTypeOf</span></a></span><span>
</span><span id="line-22"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Proxy.html#KProxy"><span class="hs-identifier">KProxy</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Show.html"><span class="hs-identifier">GHC.Show</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Read.html"><span class="hs-identifier">GHC.Read</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Enum.html"><span class="hs-identifier">GHC.Enum</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Arr.html"><span class="hs-identifier">GHC.Arr</span></a></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-comment">-- $setup</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- &gt;&gt;&gt; import Data.Void</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- &gt;&gt;&gt; import Prelude</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-comment">-- | 'Proxy' is a type that holds no data, but has a phantom parameter of</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- arbitrary type (or even kind). Its use is to provide type information, even</span><span>
</span><span id="line-37"></span><span class="hs-comment">-- though there is no value available of that type (or it may be too costly to</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- create one).</span><span>
</span><span id="line-39"></span><span class="hs-comment">--</span><span>
</span><span id="line-40"></span><span class="hs-comment">-- Historically, @'Proxy' :: 'Proxy' a@ is a safer alternative to the</span><span>
</span><span id="line-41"></span><span class="hs-comment">-- @'undefined' :: a@ idiom.</span><span>
</span><span id="line-42"></span><span class="hs-comment">--</span><span>
</span><span id="line-43"></span><span class="hs-comment">-- &gt;&gt;&gt; Proxy :: Proxy (Void, Int -&gt; Int)</span><span>
</span><span id="line-44"></span><span class="hs-comment">-- Proxy</span><span>
</span><span id="line-45"></span><span class="hs-comment">--</span><span>
</span><span id="line-46"></span><span class="hs-comment">-- Proxy can even hold types of higher kinds,</span><span>
</span><span id="line-47"></span><span class="hs-comment">--</span><span>
</span><span id="line-48"></span><span class="hs-comment">-- &gt;&gt;&gt; Proxy :: Proxy Either</span><span>
</span><span id="line-49"></span><span class="hs-comment">-- Proxy</span><span>
</span><span id="line-50"></span><span class="hs-comment">--</span><span>
</span><span id="line-51"></span><span class="hs-comment">-- &gt;&gt;&gt; Proxy :: Proxy Functor</span><span>
</span><span id="line-52"></span><span class="hs-comment">-- Proxy</span><span>
</span><span id="line-53"></span><span class="hs-comment">--</span><span>
</span><span id="line-54"></span><span class="hs-comment">-- &gt;&gt;&gt; Proxy :: Proxy complicatedStructure</span><span>
</span><span id="line-55"></span><span class="hs-comment">-- Proxy</span><span>
</span><span id="line-56"></span><span class="hs-keyword">data</span><span> </span><span id="Proxy"><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span></span><span> </span><span id="local-6989586621679506828"><span class="annot"><a href="#local-6989586621679506828"><span class="hs-identifier hs-type">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Proxy"><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span></span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span id="local-6989586621679506710"><span id="local-6989586621679506712"><span class="annot"><span class="annottext">Proxy t
Proxy t -&gt; Proxy t -&gt; Bounded (Proxy t)
forall a. a -&gt; a -&gt; Bounded a
forall k (t :: k). Proxy t
maxBound :: Proxy t
$cmaxBound :: forall k (t :: k). Proxy t
minBound :: Proxy t
$cminBound :: forall k (t :: k). Proxy t
</span><a href="GHC.Enum.html#Bounded"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Bounded</span></a></span></span></span><span> </span><span class="hs-comment">-- ^ @since 4.7.0.0</span><span>
</span><span id="line-57"></span><span>                              </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679506696"><span id="local-6989586621679506701"><span id="local-6989586621679506704"><span id="local-6989586621679506706"><span class="annot"><span class="annottext">ReadPrec [Proxy t]
ReadPrec (Proxy t)
Int -&gt; ReadS (Proxy t)
ReadS [Proxy t]
(Int -&gt; ReadS (Proxy t))
-&gt; ReadS [Proxy t]
-&gt; ReadPrec (Proxy t)
-&gt; ReadPrec [Proxy t]
-&gt; Read (Proxy t)
forall a.
(Int -&gt; ReadS a)
-&gt; ReadS [a] -&gt; ReadPrec a -&gt; ReadPrec [a] -&gt; Read a
forall k (t :: k). ReadPrec [Proxy t]
forall k (t :: k). ReadPrec (Proxy t)
forall k (t :: k). Int -&gt; ReadS (Proxy t)
forall k (t :: k). ReadS [Proxy t]
readListPrec :: ReadPrec [Proxy t]
$creadListPrec :: forall k (t :: k). ReadPrec [Proxy t]
readPrec :: ReadPrec (Proxy t)
$creadPrec :: forall k (t :: k). ReadPrec (Proxy t)
readList :: ReadS [Proxy t]
$creadList :: forall k (t :: k). ReadS [Proxy t]
readsPrec :: Int -&gt; ReadS (Proxy t)
$creadsPrec :: forall k (t :: k). Int -&gt; ReadS (Proxy t)
</span><a href="GHC.Read.html#Read"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Read</span></a></span></span></span></span></span><span>    </span><span class="hs-comment">-- ^ @since 4.7.0.0</span><span>
</span><span id="line-58"></span><span>                              </span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-comment">-- | A concrete, promotable proxy type, for use at the kind level.</span><span>
</span><span id="line-61"></span><span class="hs-comment">-- There are no instances for this because it is intended at the kind level only</span><span>
</span><span id="line-62"></span><span class="hs-keyword">data</span><span> </span><span id="KProxy"><span class="annot"><a href="Data.Proxy.html#KProxy"><span class="hs-identifier hs-var">KProxy</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679506693"><span class="annot"><a href="#local-6989586621679506693"><span class="hs-identifier hs-type">t</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span id="KProxy"><span class="annot"><a href="Data.Proxy.html#KProxy"><span class="hs-identifier hs-var">KProxy</span></a></span></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">-- It's common to use (undefined :: Proxy t) and (Proxy :: Proxy t)</span><span>
</span><span id="line-65"></span><span class="hs-comment">-- interchangeably, so all of these instances are hand-written to be</span><span>
</span><span id="line-66"></span><span class="hs-comment">-- lazy in Proxy arguments.</span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-69"></span><span id="local-6989586621679506822"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506689"><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506822"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-70"></span><span>  </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679506687"><span class="annot"><span class="annottext">== :: Proxy s -&gt; Proxy s -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">==</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span></span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-73"></span><span id="local-6989586621679506819"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506672"><span id="local-6989586621679506674"><span id="local-6989586621679506676"><span id="local-6989586621679506678"><span id="local-6989586621679506680"><span id="local-6989586621679506682"><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506819"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-74"></span><span>  </span><span id="local-6989586621679506670"><span class="annot"><span class="annottext">compare :: Proxy s -&gt; Proxy s -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#compare"><span class="hs-identifier hs-var hs-var hs-var hs-var">compare</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-77"></span><span id="local-6989586621679506815"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506664"><span id="local-6989586621679506666"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506815"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-78"></span><span>  </span><span id="local-6989586621679506662"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; Proxy s -&gt; ShowS
</span><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Proxy&quot;</span></span></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-81"></span><span id="local-6989586621679506810"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Enum.html#Enum"><span class="hs-identifier hs-type">Enum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506810"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-82"></span><span>    </span><span id="local-6989586621679506649"><span class="annot"><span class="annottext">succ :: Proxy s -&gt; Proxy s
</span><a href="GHC.Enum.html#succ"><span class="hs-identifier hs-var hs-var hs-var hs-var">succ</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Proxy s
forall a. String -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Proxy.succ&quot;</span></span><span>
</span><span id="line-83"></span><span>    </span><span id="local-6989586621679506646"><span class="annot"><span class="annottext">pred :: Proxy s -&gt; Proxy s
</span><a href="GHC.Enum.html#pred"><span class="hs-identifier hs-var hs-var hs-var hs-var">pred</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Proxy s
forall a. String -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Proxy.pred&quot;</span></span><span>
</span><span id="line-84"></span><span>    </span><span id="local-6989586621679506644"><span class="annot"><span class="annottext">fromEnum :: Proxy s -&gt; Int
</span><a href="GHC.Enum.html#fromEnum"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromEnum</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-85"></span><span>    </span><span id="local-6989586621679506638"><span class="annot"><span class="annottext">toEnum :: Int -&gt; Proxy s
</span><a href="GHC.Enum.html#toEnum"><span class="hs-identifier hs-var hs-var hs-var hs-var">toEnum</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-86"></span><span>    </span><span class="annot"><a href="GHC.Enum.html#toEnum"><span class="hs-identifier hs-var">toEnum</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Proxy s
forall a. String -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Proxy.toEnum: 0 expected&quot;</span></span><span>
</span><span id="line-87"></span><span>    </span><span id="local-6989586621679506636"><span class="annot"><span class="annottext">enumFrom :: Proxy s -&gt; [Proxy s]
</span><a href="GHC.Enum.html#enumFrom"><span class="hs-identifier hs-var hs-var hs-var hs-var">enumFrom</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-88"></span><span>    </span><span id="local-6989586621679506635"><span class="annot"><span class="annottext">enumFromThen :: Proxy s -&gt; Proxy s -&gt; [Proxy s]
</span><a href="GHC.Enum.html#enumFromThen"><span class="hs-identifier hs-var hs-var hs-var hs-var">enumFromThen</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-89"></span><span>    </span><span id="local-6989586621679506634"><span class="annot"><span class="annottext">enumFromThenTo :: Proxy s -&gt; Proxy s -&gt; Proxy s -&gt; [Proxy s]
</span><a href="GHC.Enum.html#enumFromThenTo"><span class="hs-identifier hs-var hs-var hs-var hs-var">enumFromThenTo</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-90"></span><span>    </span><span id="local-6989586621679506633"><span class="annot"><span class="annottext">enumFromTo :: Proxy s -&gt; Proxy s -&gt; [Proxy s]
</span><a href="GHC.Enum.html#enumFromTo"><span class="hs-identifier hs-var hs-var hs-var hs-var">enumFromTo</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-93"></span><span id="local-6989586621679506803"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506803"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-94"></span><span>    </span><span id="local-6989586621679506622"><span class="annot"><span class="annottext">range :: (Proxy s, Proxy s) -&gt; [Proxy s]
</span><a href="GHC.Ix.html#range"><span class="hs-identifier hs-var hs-var hs-var hs-var">range</span></a></span></span><span> </span><span class="annot"><span class="annottext">(Proxy s, Proxy s)
</span><span class="hs-identifier">_</span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-95"></span><span>    </span><span id="local-6989586621679506620"><span class="annot"><span class="annottext">index :: (Proxy s, Proxy s) -&gt; Proxy s -&gt; Int
</span><a href="GHC.Ix.html#index"><span class="hs-identifier hs-var hs-var hs-var hs-var">index</span></a></span></span><span> </span><span class="annot"><span class="annottext">(Proxy s, Proxy s)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-96"></span><span>    </span><span id="local-6989586621679506618"><span class="annot"><span class="annottext">inRange :: (Proxy s, Proxy s) -&gt; Proxy s -&gt; Bool
</span><a href="GHC.Ix.html#inRange"><span class="hs-identifier hs-var hs-var hs-var hs-var">inRange</span></a></span></span><span> </span><span class="annot"><span class="annottext">(Proxy s, Proxy s)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-97"></span><span>    </span><span id="local-6989586621679506616"><span class="annot"><span class="annottext">rangeSize :: (Proxy s, Proxy s) -&gt; Int
</span><a href="GHC.Ix.html#rangeSize"><span class="hs-identifier hs-var hs-var hs-var hs-var">rangeSize</span></a></span></span><span> </span><span class="annot"><span class="annottext">(Proxy s, Proxy s)
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-98"></span><span>    </span><span id="local-6989586621679506614"><span class="annot"><span class="annottext">unsafeIndex :: (Proxy s, Proxy s) -&gt; Proxy s -&gt; Int
</span><a href="GHC.Ix.html#unsafeIndex"><span class="hs-identifier hs-var hs-var hs-var hs-var">unsafeIndex</span></a></span></span><span> </span><span class="annot"><span class="annottext">(Proxy s, Proxy s)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-99"></span><span>    </span><span id="local-6989586621679506612"><span class="annot"><span class="annottext">unsafeRangeSize :: (Proxy s, Proxy s) -&gt; Int
</span><a href="GHC.Ix.html#unsafeRangeSize"><span class="hs-identifier hs-var hs-var hs-var hs-var">unsafeRangeSize</span></a></span></span><span> </span><span class="annot"><span class="annottext">(Proxy s, Proxy s)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-102"></span><span id="local-6989586621679506796"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506796"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-103"></span><span>    </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679506605"><span class="annot"><span class="annottext">&lt;&gt; :: Proxy s -&gt; Proxy s -&gt; Proxy s
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-104"></span><span>    </span><span id="local-6989586621679506604"><span class="annot"><span class="annottext">sconcat :: NonEmpty (Proxy s) -&gt; Proxy s
</span><a href="GHC.Base.html#sconcat"><span class="hs-identifier hs-var hs-var hs-var hs-var">sconcat</span></a></span></span><span> </span><span class="annot"><span class="annottext">NonEmpty (Proxy s)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-105"></span><span>    </span><span id="local-6989586621679506601"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; Proxy s -&gt; Proxy s
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span></span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-108"></span><span id="local-6989586621679506792"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506595"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506792"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-109"></span><span>    </span><span id="local-6989586621679506592"><span class="annot"><span class="annottext">mempty :: Proxy s
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-110"></span><span>    </span><span id="local-6989586621679506591"><span class="annot"><span class="annottext">mconcat :: [Proxy s] -&gt; Proxy s
</span><a href="GHC.Base.html#mconcat"><span class="hs-identifier hs-var hs-var hs-var hs-var">mconcat</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Proxy s]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy s
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span></span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-113"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506588"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-114"></span><span>    </span><span id="local-6989586621679506586"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Proxy a -&gt; Proxy b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Proxy a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy b
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-115"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#fmap"><span class="hs-pragma hs-type">fmap</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-118"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506576"><span id="local-6989586621679506578"><span id="local-6989586621679506580"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-119"></span><span>    </span><span id="local-6989586621679506574"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; Proxy a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy a
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-121"></span><span>    </span><span class="annot"><span class="annottext">Proxy (a -&gt; b)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679506573"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. Proxy (a -&gt; b) -&gt; Proxy a -&gt; Proxy b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy b
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-125"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506565"><span id="local-6989586621679506567"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-126"></span><span>    </span><span id="local-6989586621679506563"><span class="annot"><span class="annottext">empty :: forall a. Proxy a
</span><a href="GHC.Base.html#empty"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy a
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-127"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#empty"><span class="hs-pragma hs-type">empty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-128"></span><span>    </span><span class="annot"><span class="annottext">Proxy a
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679506561"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. Proxy a -&gt; Proxy a -&gt; Proxy a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span class="annot"><span class="annottext">Proxy a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy a
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-129"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;|&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="hs-comment">-- | @since 4.7.0.0</span><span>
</span><span id="line-132"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506553"><span id="local-6989586621679506555"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-133"></span><span>    </span><span class="annot"><span class="annottext">Proxy a
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679506551"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. Proxy a -&gt; (a -&gt; Proxy b) -&gt; Proxy b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Proxy b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy b
forall k (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-134"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;=</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-137"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679506543"><span id="local-6989586621679506545"><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span></span></span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span class="hs-comment">-- | 'asProxyTypeOf' is a type-restricted version of 'const'.</span><span>
</span><span id="line-140"></span><span class="hs-comment">-- It is usually used as an infix operator, and its typing forces its first</span><span>
</span><span id="line-141"></span><span class="hs-comment">-- argument (which is usually overloaded) to have the same type as the tag</span><span>
</span><span id="line-142"></span><span class="hs-comment">-- of the second.</span><span>
</span><span id="line-143"></span><span class="hs-comment">--</span><span>
</span><span id="line-144"></span><span class="hs-comment">-- &gt;&gt;&gt; import Data.Word</span><span>
</span><span id="line-145"></span><span class="hs-comment">-- &gt;&gt;&gt; :type asProxyTypeOf 123 (Proxy :: Proxy Word8)</span><span>
</span><span id="line-146"></span><span class="hs-comment">-- asProxyTypeOf 123 (Proxy :: Proxy Word8) :: Word8</span><span>
</span><span id="line-147"></span><span class="hs-comment">--</span><span>
</span><span id="line-148"></span><span class="hs-comment">-- Note the lower-case @proxy@ in the definition. This allows any type</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- constructor with just one argument to be passed to the function, for example</span><span>
</span><span id="line-150"></span><span class="hs-comment">-- we could also write</span><span>
</span><span id="line-151"></span><span class="hs-comment">--</span><span>
</span><span id="line-152"></span><span class="hs-comment">-- &gt;&gt;&gt; import Data.Word</span><span>
</span><span id="line-153"></span><span class="hs-comment">-- &gt;&gt;&gt; :type asProxyTypeOf 123 (Just (undefined :: Word8))</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- asProxyTypeOf 123 (Just (undefined :: Word8)) :: Word8</span><span>
</span><span id="line-155"></span><span id="local-6989586621679506752"><span id="local-6989586621679506753"><span class="annot"><a href="Data.Proxy.html#asProxyTypeOf"><span class="hs-identifier hs-type">asProxyTypeOf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679506753"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679506752"><span class="hs-identifier hs-type">proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679506753"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679506753"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-156"></span><span id="asProxyTypeOf"><span class="annot"><span class="annottext">asProxyTypeOf :: forall a (proxy :: * -&gt; *). a -&gt; proxy a -&gt; a
</span><a href="Data.Proxy.html#asProxyTypeOf"><span class="hs-identifier hs-var hs-var">asProxyTypeOf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; proxy a -&gt; a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span>
</span><span id="line-157"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Proxy.html#asProxyTypeOf"><span class="hs-pragma hs-type">asProxyTypeOf</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span></pre></body></html>